package com.hss01248.facedetect;

import android.app.Application;
import android.content.Context;

import com.zhy.http.okhttp.OkHttpUtils;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;


/**
 * Used 自定义Application【系统上下文】
 */
public class MyApplication extends Application {

    /**
     * 售票终端编号
     */
    public static String SALE_TICKET_TERMINAL_ID = "";

    /**
     * 检票终端编号
     */
    public static String CHECK_TICKET_TERMINAL_N0 = "";
    /**
     * 检票终端用户id
     */
    public static String USER_ID="";

    /**
     * 系统上下文
     */
    private static Context mAppContext;
    static MyApplication myApplication = new MyApplication();

    public static MyApplication getMyApplication() {
        return myApplication;
    }

    public static int position;
    public static boolean unBind;
    //用于拼接网络请求字符串
    public static String m_Url="";
    public static String http="http://";
    @Override
    public void onCreate() {
        super.onCreate();
        mAppContext = getApplicationContext();

        OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                .addInterceptor(new LoggerInterceptor("TAG"))
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();

        OkHttpUtils.initClient(okHttpClient);
    }

    /**
     * 获取系统上下文：用于ToastUtil类
     */
    public static Context getAppContext() {
        return mAppContext;
    }
}